﻿namespace LanSunERP
{
    using System;
    using System.ServiceModel;
    using System.Windows.Forms;
    using System.Diagnostics;
    using System.Collections.Generic;
    using System.Runtime.Serialization;
    using System.Collections;
    using System.Data;
    using System.Data.SqlClient;

    public class UserRightManagement:QueryCommand
    {
              public UserRightManagement() : base () { }
              public UserRightManagement(SqlCommand cmdSQL, DataTable dtRequest,string RequestJob)
         : base(cmdSQL, dtRequest,RequestJob) {  }

        public SqlCommand BuildCommand()
        {
           switch (RequestJob.Substring(6, 10))
            {
                //UserRightManagement
                case "0000": break;
                case "1000": break;
                case "1001":
                    cmdSQL.Parameters.Add(new SqlParameter("@SysID", dwRequest["SysID"].ToString()));
                    break;
                case "1002": break;
                case "2000":
                case "3000":
                    cmdSQL.Parameters.Add(new SqlParameter("@SysID", dwRequest["SysID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@UserID", dwRequest["UserID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@UserName", dwRequest["UserName"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@UserGroup", dwRequest["UserGroup"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@AppID", dwRequest["AppID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@AppKey", dwRequest["AppKey"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@TableID", dwRequest["TableID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@TableName", dwRequest["TableName"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@ProfileID", dwRequest["ProfileID"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@ProfileKey", dwRequest["ProfileKey"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@Type", dwRequest["Type"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@SubStatus", dwRequest["SubStatus"].ToString()));
                    cmdSQL.Parameters.Add(new SqlParameter("@Status", dwRequest["Status"].ToString()));
                    
                    break;
                case "2001":case "4000":
                    cmdSQL.Parameters.Add(new SqlParameter("@InstanceID", dwRequest["InstanceID"].ToString())); 
                    break;
            }
             return cmdSQL;

        }      

    }
}